<?php

namespace App\Http\Requests\Company\Register;
use App\Http\Requests\Request;

class CompanyBasicRequest extends Request {
    public function authorize(){
        return true;
    }
    public function rules(){
        $input = $this->all();
        return [
            'company_name'=>'required',
            'industry'=>'required',
            'comkind'=>'required',
            'established'=>'required',
            'employee_num'=>'required',
            'showTemptation'=>'required',
            'profile'=>'required',
            'contacts'=>'required',
            'phone' => 'check_phone:'.$input['area_code'].','.$input['ext'],
            'fax' => 'check_fax',
            'email' => 'email',
            'qq' => 'check_qq',
            'region' => 'required',
            'address'=>'required',
        ];
    }
    public function messages(){
        return [
            'company_name.required'=>'公司名称必须填写',
            'industry.required'=>'请选择所属行业',
            'comkind.required'=>'请选择公司性质',
            'established.required'=>'请选择成立年份',
            'employee_num.required'=>'请选择员工数量',
            'showTemptation.required'=>'请选择公司诱惑',
            'profile.required'=>'公司简介必须填写',
            'contacts.required'=>'联系人必须填写',
            'phone.check_phone'=>'请输入正确的区号和电话号码',
            'fax.check_fax'=>'请输入正确的传真号码',
            'email.email'=>'请输入正确的邮箱',
            'qq.check_qq'=>'请输入正确的qq号码',
            'region.required'=>'请选择地区',
            'address.required'=>'详细地址必须填写',
        ];
    }
}